﻿using System.ComponentModel.DataAnnotations;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Extensions;
using HengTong.Model.Db;
using HengTong.Model._Admin;
using HengTong.Model.Db.Other;
using HengTong.Model.Db.Other.Bill;
using TiaoTaoHelper.Wtm.Models;


namespace HengTong.ViewModel.Visitor.SysVisitorRecordRequestBillVms
{
    public partial class SysVisitorRecordRequestBillTemplateVm : BaseTemplateVM
    {
        [Display(Name = "访客事由ID")]
        public ExcelPropety VisitorReasonExcel = ExcelPropety.CreateProperty<SysVisitorRecordRequestBill>(x => x.VisitorReasonId);
        [Display(Name = "姓名")]
        public ExcelPropety NameExcel = ExcelPropety.CreateProperty<SysVisitorRecordRequestBill>(x => x.Name);
        [Display(Name = "手机号")]
        public ExcelPropety PhoneExcel = ExcelPropety.CreateProperty<SysVisitorRecordRequestBill>(x => x.Phone);
        [Display(Name = "身份证号")]
        public ExcelPropety IdCardNoExcel = ExcelPropety.CreateProperty<SysVisitorRecordRequestBill>(x => x.IdCardNo);
        [Display(Name = "所属单位/公司")]
        public ExcelPropety CompanyExcel = ExcelPropety.CreateProperty<SysVisitorRecordRequestBill>(x => x.Company);
        [Display(Name = "车牌号")]
        public ExcelPropety CarNoExcel = ExcelPropety.CreateProperty<SysVisitorRecordRequestBill>(x => x.CarNo);
        [Display(Name = "绑定用户")]
        public ExcelPropety UserExcel = ExcelPropety.CreateProperty<SysVisitorRecordRequestBill>(x => x.UserId);
        [Display(Name = "预约时间")]
        public ExcelPropety ReservationTimeExcel = ExcelPropety.CreateProperty<SysVisitorRecordRequestBill>(x => x.ReservationTime);
        [Display(Name = "接待人")]
        public ExcelPropety ReceptionistExcel = ExcelPropety.CreateProperty<SysVisitorRecordRequestBill>(x => x.Receptionist);
        [Display(Name = "接待人电话")]
        public ExcelPropety ReceptionistPhoneExcel = ExcelPropety.CreateProperty<SysVisitorRecordRequestBill>(x => x.ReceptionistPhone);
        [Display(Name = "拒绝原因")]
        public ExcelPropety RejectReasonExcel = ExcelPropety.CreateProperty<SysVisitorRecordRequestBill>(x => x.RejectReason);
        [Display(Name = "入厂时间")]
        public ExcelPropety EntryTimeExcel = ExcelPropety.CreateProperty<SysVisitorRecordRequestBill>(x => x.EntryTime);
        [Display(Name = "出厂时间")]
        public ExcelPropety LeaveTimeExcel = ExcelPropety.CreateProperty<SysVisitorRecordRequestBill>(x => x.LeaveTime);
        [Display(Name = "审批人")]
        public ExcelPropety ApproverExcel = ExcelPropety.CreateProperty<SysVisitorRecordRequestBill>(x => x.Approver);
        [Display(Name = "审批时间")]
        public ExcelPropety ApprovalTimeExcel = ExcelPropety.CreateProperty<SysVisitorRecordRequestBill>(x => x.ApprovalTime);
        [Display(Name = "所属部门")]
        public ExcelPropety GroupExcel = ExcelPropety.CreateProperty<SysVisitorRecordRequestBill>(x => x.GroupId);
        [Display(Name = "单据编号")]
        public ExcelPropety BillCodeExcel = ExcelPropety.CreateProperty<SysVisitorRecordRequestBill>(x => x.BillCode);
        [Display(Name = "单据状态")]
        public ExcelPropety BillStatusExcel = ExcelPropety.CreateProperty<SysVisitorRecordRequestBill>(x => x.BillStatus);
        [Display(Name = "备注")]
        public ExcelPropety RemarkExcel = ExcelPropety.CreateProperty<SysVisitorRecordRequestBill>(x => x.Remark);

	    protected override void InitVM()
        {
            VisitorReasonExcel.DataType = ColumnDataType.ComboBox;
            VisitorReasonExcel.ListItems = DC.Set<SysVisitorReason>().GetSelectListItems(Wtm, y => y.ReasonName);
            UserExcel.DataType = ColumnDataType.ComboBox;
            UserExcel.ListItems = DC.Set<FrameworkUser>().GetSelectListItems(Wtm, y => y.Name);
            GroupExcel.DataType = ColumnDataType.ComboBox;
            GroupExcel.ListItems = DC.Set<SysGroup>().GetSelectListItems(Wtm, y => y.GroupName);
        }

    }

    public class SysVisitorRecordRequestBillImportVm : BaseImportVM<SysVisitorRecordRequestBillTemplateVm, SysVisitorRecordRequestBill>
    {

    }

}
